home *** CD-ROM | disk | FTP | other *** search
/ DOpus Plus / DOpus Plus.iso / Tutorial / C Guide / Simple_Module1 / ModuleEntry.c < prev    next >
C/C++ Source or Header  |  1998-09-20  |  2KB  |  67 lines

  1. /*******************************************************************
  2.  
  3.    ModuleEntry.c
  4.  
  5.    It must contain at least all what is here.
  6.  
  7.    I would suggest to you not to write much more than the needed
  8.    calls to your functions here. So you may forget later a little
  9.    bit, that you are writing a library...
  10.  
  11. *********************************************************************/
  12.  
  13. // we are doing all other include stuff there
  14. #include "includes/Project.h"
  15.  
  16. // I use heavily defines, so this must not so much reworked each time,
  17. // I change only the Project.h...
  18.  
  19. ModuleInfo module_info =
  20. {
  21.     MODULE_VER_NUMBER,
  22.     MODULE_NAME,
  23.     MODULE_CATALOG,
  24.     MODULE_FLAGS,
  25.     MODULE_FUNC_COUNT,
  26.  
  27.     { FUNC0_ID, COMMAND_0, FUNC0_DESCRIPTION, FUNC0_FLAGS, FUNC0_TEMPLATE }
  28. };
  29.  
  30. // now you must modify some lines, if your module should have more than
  31. // one command buildin...
  32. // For example we make here at all 3 commands. The 3. command itself is a
  33. // hidden command (is not shown in the commandlist...)
  34.  
  35. #if MODULE_FUNC_COUNT-1
  36.  
  37. ModuleFunction module_func[MODULE_FUNC_COUNT-1] =
  38.     { FUNC1_ID, COMMAND_1, FUNC1_DESCRIPTION, FUNC1_FLAGS, FUNC1_TEMPLATE },
  39.     { FUNC2_ID, COMMAND_2, FUNC2_DESCRIPTION, FUNC2_FLAGS, FUNC2_TEMPLATE }
  40. };
  41.  
  42. #endif
  43.  
  44.  
  45. // If you are a really nice programmer, you should provide the version
  46. // string with some extra \0 's...
  47.  
  48. static char version[] = "\0$VER: " VERSION_STRING " " __AMIGADATE__ "\0";
  49.  
  50. /********************************************************************/
  51. // Now we are ready to enter our program code...
  52.  
  53. int __asm __saveds L_Module_Entry( register __a0 char *args,              
  54.                                    register __a1 struct Screen *screen,   
  55.                                    register __a2 IPCData *ipc,
  56.                                    register __a3 IPCData *main_ipc,
  57.                                    register __d0 ULONG mod_id,
  58.                                    register __d1 EXT_FUNC(func_callback) )
  59. {               
  60.     // your function...
  61.  
  62.     return 1;
  63. }
  64.  
  65.  
  66.